﻿<!-- 道途  9:48:03 -->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="bootstrap.css" rel="stylesheet" />
    <script src="jquery-1.7.1.js"></script>
    <script type="text/javascript">
        $(function () {
            $(".sub_item_del").bind("click",function () {
                var $btn_del = $(this);
                var $input_del = $btn_del.prev();
                var $total_count = $("#total_count").text() - 0;
                var $remaining_count = $total_count - ($input_del.val() - 0);
                $("#total_count").text($remaining_count);

                var td_del = this.parentNode;
                var tr_del = td_del.parentNode;
                tr_del.parentNode.removeChild(tr_del);
                var tr_index = 1;
                $(".th_sort").each(function () {                    
                    this.innerHTML = tr_index;
                    tr_index = tr_index + 1;
                });
            });
        });
    </script>
</head>
<body>
    <table id="tblSort" class="table table-striped table-bordered table-hover ">
        <tbody>
            <tr>
                <th class=""><i class="th_sort">1</i></th>
                <td>
                    <input type="text" id="Text1" name=""  />
                    <input type="button" id="Button1" class="sub_item_del" value="删除" />
                </td>
            </tr>
            <tr>
                <th class=""><i class="th_sort">2</i></th>
                <td>
                    <input type="text" id="Text2" name=""  />
                    <input type="button" id="Button2" class="sub_item_del" value="删除" />
                </td>
            </tr>
            <tr>
                <th class=""><i class="th_sort">3</i></th>
                <td>
                    <input type="text" id="Text3" name=""  />
                    <input type="button" id="Button3" class="sub_item_del" value="删除" />
                </td>
            </tr>
            <tr>
                <th>总数量：</th>
                <td> <span id="total_count">50</span></td>
            </tr>
        </tbody>
    </table>
</body>
<html>
